home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / COMMUNIC / H191.ZIP / CA29-3.EXE / SPRINT.CMD < prev    next >
OS/2 REXX Batch file  |  1993-04-27  |  3KB  |  73 lines

  1. S0 = 10                ; Dialing directory number we'll use
  2. ; ----- SprintNet: Connect to SprintNet
  3. ; ----------------------------------------------------------------
  4. ;    Note: This script may be used by itself (to put you at Sprint-
  5. ;    Net's "@ " prompt, or may be FCALLed by another script.     This
  6. ;    script is written to be FCALLed, executed directly (F2) or
  7. ;    attached to a dialing directory entry (for manual execution).
  8. ; ----------------------------------------------------------------
  9. ;    Note: Change the value above to reflect the dialing directory
  10. ;    entry number you have prepared.     The default is "10".
  11. ; ----------------------------------------------------------------
  12. ;    S0 is modified by this script.
  13. ;    SUCCESS/FAILED is returned by this script to an FCALLer
  14. ; ----------------------------------------------------------------
  15. ;    Make connection to SprintNet.  The dialing directory (or current
  16. ;    .. setting define parity and speed).
  17. ;
  18.     LEGEND " Dialing SprintNet... "
  19.     IF NOT LINKED        ; If script not invoked from Alt-D
  20.        DIAL S0        ; Call dial dir entry number 10 (SprintNet)
  21.        IF FAILED GOTO Exit    ; IF esc out, terminate script
  22.        ENDIF        ; End if not linked
  23. ;
  24. ;    Make connection according to the dialing directory's parity/speed
  25. ;    .. i.e: parity and speed make a difference in how we connect
  26. ;
  27.     PAUSE 5                ; Wait for the modem to settle
  28.     COMPARMS S0            ; Get current settings
  29.     IF STRCMP "N" S0(5:5)        ; If no parity
  30.        IF STRCMP "2400" S0(0:3)    ; If 2400 baud connect Send @D<cr>
  31.           TRANS "@"            ;    Send @D<cr> slowly
  32.           PAUSE 1            ;    Wait a moment
  33.           TRANS "D"            ;    Set to 8N1
  34.           PAUSE 1            ;    Wait a moment
  35.           TRANS "!"            ;    Set to 8N1
  36.        ELSE                ; ELSE 300/1200 (send <cr>D<cr>)
  37.           TRANSMIT "!D"        ;    Transmit Carriage return <CR> D
  38.           PAUSE 1            ;    Wait 1 sec
  39.           TRANSMIT "!"        ;    .. (8 bit identifier)
  40.           ENDIF
  41.     ELSE                ; ELSE even or odd parity
  42.        IF STRCMP "2400" S0(0:3)    ; If 2400 baud connect Send @D<cr>
  43.           TRANS "@"            ;    Send @D<cr> slowly
  44.           PAUSE 1            ;    Wait a moment
  45.           TRANS "D"            ;    Set to 8N1
  46.           PAUSE 1            ;    Wait a moment
  47.           TRANS "!"            ;    Set to 8N1
  48.        ELSE                ; ELSE 300/1200 (send <cr><cr>)
  49.           TRANSMIT "!"        ;    Transmit Carriage return <CR>
  50.           PAUSE 2            ;    Wait 1 sec
  51.           TRANSMIT "!"        ;    Transmit Carriage return <CR>
  52.           ENDIF
  53.        ENDIF
  54. ;
  55. ;    Send terminal identification
  56. ;
  57.     WAITFOR "TERMINAL="    ; Wait for the prompt
  58.     TRANSMIT "D1!"        ; Set terminal type
  59.     WAITFOR "@"        ; Wait for next prompt
  60. ;
  61. ;    Set a few more values
  62. ;
  63.     SET BSUPPRESS OFF    ; Turn off blank line suppression
  64.     SET MASK ON        ; Turn on high bit mask
  65.     SET CDISPLAY ON        ; Display ctl chars
  66.     SET SUCCESS ON        ; Report success
  67. ;
  68. ;    Exit - this script may be called
  69. ;
  70. Exit:
  71.     IF FCALLED FRETURN    ; Return to caller if called
  72.     ALARM            ; Sound alarm - we're done
  73.